import http from "@/common/http";
import productListResponse from './mock/product.json'

export async function queryProduct(params: any, useMock?: boolean) {
  if (useMock) {
    return Promise.resolve(productListResponse)
  }
  return http.get('/api/product/product/list', params)
}

export async function removeProduct(data: number[]) {
  return http.post('/api/product/product/delete', data)
}

export async function addProduct(data: any) {
  return http.post('/api/product/product/add', data)
}

export async function updateProduct(data: any) {
  return http.put('/api/product/product/add', data)
}
